import sys
sys.path.insert(0, '/apdcephfs/share_976139/users/xuelonggeng/code/dragon_ai')
# import dragon_ai
data_path = "/apdcephfs_qy3/share_976139/users/xuelonggeng/data/emotion_data/ft_local/tar.list"
data_list_path = "/apdcephfs_qy3/share_976139/users/xuelonggeng/data/emotion_data/ft_local/data_no_wav.list"
print(f'hahaha我是耿雪龙，开始执行函数')
# dragon_ai.do_extract_str_info_from_shards(data_path, data_list_path)
# data_loader = dragon_ai.do_get_data_loader_for_read(data_path, batch_size=50)
# for batch in data_loader:
#     sorted_key = batch['keys']
#     sorted_txt = batch['labels']
#     sorted_wav = batch['wavs']
#     sorted_extra_dicts = batch['extra_dicts']
#     sorted_file_path = batch['tar_files']

from gxl_ai_utils.utils import utils_file

dict_list = utils_file.load_dict_list_from_jsonl(data_list_path)
txt_dict = {}
output_dict_path = "/apdcephfs_qy3/share_976139/users/xuelonggeng/data/emotion_data/ft_local/text.scp"
for item in utils_file.tqdm(dict_list):
    txt_dict[item['key']] = item['txt']
utils_file.write_dict_to_scp(txt_dict, output_dict_path)

